package cn.xiaobai.loader;

import java.util.jar.JarEntry;

/**
 * 自定义引导类
 *
 * @Author yangdaji
 * @Date 2023/10/26
 * @PackageName cn.xiaobai.loader
 * @ClassName JarLauncher
 */
public class JarLauncher extends Launcher {

    private static final String BOOT_INF_CLASSES = "BOOT-INF/classes/";
    private static final String BOOT_INF_LIB = "BOOT-INF/classes/lib/";


    public static void main(String[] args) throws Exception {
        new JarLauncher().launch(args);
    }

    @Override
    protected boolean isNested(JarEntry jarEntry) {
        String entryName = jarEntry.getName();
        return entryName.contains(BOOT_INF_CLASSES);
    }


    @Override
    protected String matchClassName(String name) {
        return ClassConvertUtils.convertClassName(name, BOOT_INF_CLASSES);
    }

}
